﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RoleManagement.ascx.cs" Inherits="Web.Cms.Roles.RoleManagement" %>
<p class="heading">
        Quản trị nhóm người dùng
    </p>
<table border="0" cellpadding="2" cellspacing="2" width="100%" id="tblRoleManager"
    runat="server">
    <tr>
        <td>
            <asp:Button ID="btnBack" runat="server" SkinID="AdminButtonBack" OnClick="btnBack_Click" /></td>
        <td align="right">
            <div style="float: right; padding-right: 20px;" runat="server" id="divInsertItem">
                <img src="/App_Themes/Default/Images/Buttons/add.png" border="0" />
                <asp:LinkButton ID="lnkInsertItem" CssClass="linkAdd" runat="server" OnClick="lnkInsertItem_Click">Tạo mới</asp:LinkButton>
            </div>
        </td>
    </tr>
    <tr>
        <td class="InputBox" valign="top" width="40%" colspan="2">
            <asp:GridView ID="grvRoles" runat="server" AutoGenerateColumns="False" Width="100%"
                SkinID="AdminGrid" OnRowCommand="grvRoles_RowCommand" OnSelectedIndexChanged="grvRoles_SelectedIndexChanged"
                DataKeyNames="RoleID" OnPageIndexChanging="grvRoles_PageIndexChanging">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            STT</HeaderTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblSTT" runat="server"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="RoleName" HeaderText="Nh&#243;m" />
                    <asp:BoundField DataField="Description" HeaderText="M&#244; tả" />
                    <asp:TemplateField>
                        <ItemStyle HorizontalAlign="Center" Width="70" />
                        <HeaderTemplate>
                            Thông tin
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Button ID="btnSelect" runat="server" CommandName="select" SkinID="IconInfo"
                                ToolTip="Thông tin về nhóm người dùng" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Chức năng</HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                        <ItemTemplate>
                            <asp:Button ID="btnRoleFunction" runat="server" CommandName="rolefunction" SkinID="IconSetting"
                                ToolTip="Phân quyền chức năng" CommandArgument='<%# Eval("RoleID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            Phân nhóm</HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="70px" />
                        <ItemTemplate>
                            <asp:Button ID="btnUsersInRole" runat="server" CommandName="usersinrole" SkinID="IconGroup"
                                ToolTip="Phân nhóm cho người dùng" CommandArgument='<%# Eval("RoleID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                     <asp:TemplateField>
                        <HeaderTemplate>
                            Phân chuyên mục
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center" Width="120px" />
                        <ItemTemplate>               
                         <asp:Button ID="btnUserZones" runat="server" CommandName="Userzones" CommandArgument='<%# Eval("RoleID") %>'
                                ToolTip="Phân chuyên mục người dùng" SkinID="IconUserZones" />
                         
                        </ItemTemplate>
                    </asp:TemplateField>
                     
                    <asp:TemplateField>
                        <HeaderStyle HorizontalAlign="center" />
                        <HeaderTemplate>
                            Xóa</HeaderTemplate>
                        <ItemStyle HorizontalAlign="center" />
                        <ItemTemplate>
                            <asp:Button ID="btnDelete" runat="server" CommandName="deleterole" SkinID="IconDelete"
                                ToolTip="Xóa nhóm người dùng" CommandArgument='<%# Eval("RoleID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
    <tr>
        <td align="center" colspan="2">
            <table border="0" cellpadding="2" cellspacing="8" width="50%">
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:TextBox ID="txtRoleID" Visible="false" runat="server" Enabled="False" ReadOnly="True"
                            Width="42px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="height: 26px">
                        <strong>Tên nhóm:</strong></td>
                    <td style="height: 26px" align="left">
                        <asp:TextBox ID="txtRoleName" runat="server" Width="179px" Height="25" onfocus="setBKColor(event);"
                            onblur="reSetBKColor(event);" CssClass="inputRequired"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtRoleName"
                            Display="Dynamic" ErrorMessage="Không được để trống" ValidationGroup="rolegroup"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td valign="top">
                        <strong>Mô tả nhóm:</strong></td>
                    <td align="left">
                        <asp:TextBox ID="txtDescription" runat="server" Height="61px" TextMode="MultiLine"
                            Width="300"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnUpdate" runat="server" SkinID="AdminButtonUpdate" OnClick="btnUpdate_Click"
                            ValidationGroup="rolegroup" />
                        <asp:Button ID="btnAdd" runat="server" SkinID="AdminButtonInsert" OnClick="btnAdd_Click"
                            ValidationGroup="rolegroup" />
                        <asp:Button ID="btnDeleteRole" runat="server" SkinID="AdminButtonDelete" OnClick="btnDeleteRole_Click" />&nbsp;
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

